#include "DIVA_RenderData.h"

DIVA_RenderData* DIVA_RenderData::singletonPtr = 0;
DIVA_RenderData::DIVA_RenderData(){

		//mTranslateVector(Ogre::Vector3::ZERO)
        mAvgFrameTime = 0.02f;

		
        mRotX = 0.0f;
		mRotY = 0.0f;
		mRotZ = 0.0f;
        mMoveFwd = false;
        mMoveBck = false;
        mMoveLeft = false;
        mMoveRight = false;
		mMoveUp = false ;
		mMoveDown = false ;
		mRollRight = false ;
		mRollLeft = false ;
}
DIVA_RenderData::~DIVA_RenderData(){
	delete singletonPtr;
}
DIVA_RenderData* DIVA_RenderData::getSingletonPtr(){
	if (!singletonPtr)
		singletonPtr = new DIVA_RenderData();
	return singletonPtr;
}
void DIVA_RenderData::moveFwd(bool b){		
	mMoveFwd = b;
}
void DIVA_RenderData::moveBck(bool b){
	mMoveBck = b;
}
void DIVA_RenderData::moveLeft(bool b){	    
    mMoveLeft = b;
}
void DIVA_RenderData::moveRight(bool b){
	mMoveRight = b;
}
void DIVA_RenderData::moveUp(bool b){
	mMoveUp = b;
}
void DIVA_RenderData::moveDown(bool b){
	mMoveDown = b;
}
void DIVA_RenderData::origin(bool b) { 
	mOrigin = b;
}
void DIVA_RenderData::rollRight(bool b) { 
	mRollRight = b;
}
void DIVA_RenderData::rollLeft(bool b) { 
	mRollLeft = b;
}


bool DIVA_RenderData::ifMoveFwd(){
	return mMoveFwd;
}
bool DIVA_RenderData::ifMoveBck(){
	return mMoveBck;
}
bool DIVA_RenderData::ifMoveLeft(){
	return mMoveLeft;
}
bool DIVA_RenderData::ifMoveRight(){
	return mMoveRight;
}
bool DIVA_RenderData::ifMoveUp(){
	return mMoveUp;
}
bool DIVA_RenderData::ifMoveDown(){
	return mMoveDown;
}
bool DIVA_RenderData::ifOrigin() {
	return mOrigin ;
}
bool DIVA_RenderData::ifRollRight() {
	return mRollRight ;
}
bool DIVA_RenderData::ifRollLeft() {
	return mRollLeft ;
}

bool DIVA_RenderData::ifUpdated(){
	bool mUpdateFlag = mMoveFwd || mMoveBck || mMoveLeft || mMoveRight || mMoveUp || mMoveDown||  mRollRight || mRollLeft || mRotX || mRotY ;
	return mUpdateFlag;
}